package com.azier.kapacitor.script.node.nodebind;

import com.azier.kapacitor.script.node.ChangeDetectNode;
import com.azier.kapacitor.script.node.Node;

/**
* 1 * @Author: luoj
* 2 * @Date: 2019/11/8 11:27
* 3
*/

/**
Create a new node that emits new points only if different from the previous point
**/

/**
创建一个仅在与上一个点不同时才发出新点的新节点
**/
public interface ChangeDetectNodeBind extends Node {
    /**
     Create a new Barrier node that emits a BarrierMessage periodically
     **/
    /**
     创建一个新的Barrier节点，该节点定期发出BarrierMessage
     **/
    default ChangeDetectNode changeDetect(){
        ChangeDetectNode nextNode = new ChangeDetectNode();
        this.setNextNode(nextNode);
        nextNode.zetHeadNode(this.getHeadNode());
        return nextNode;
    }
}